﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleCardCreat.aspx.cs" Inherits="PPAP.Web.Master.SampleCardCreat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title></title>
    <script language="javascript">
        function add() {
            url = "SampleCardEdit.aspx";
            PopUpWindow(url, 230, 160, 730, 420);
        }
        function edit(id) {
            url = "SampleCardEdit.aspx?DID=" + id;
            PopUpWindow(url, 230, 160, 730, 420);
        }
        function del(id) {
            if (confirm('Please confirm to delete the file.')) {
                url = "SampleCardCreat.aspx?deid=" + id;
                window.location.href = url;
            }
        }
		</script>
</head>
<body  style="font-family: Arial, Helvetica, sans-serif;" >
    <form id="form1" runat="server">
    <div>
    <table width="100%" style="display:none;">
    <tr><td>
        Test item
        </td><td>
            <asp:TextBox ID="txtTest" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td>
            Department
        </td><td>
            <asp:DropDownList ID="ddlDepartment" runat="server">
            </asp:DropDownList>
        </td></tr>
        <tr><td>
        Remark
        </td><td>
            <asp:TextBox ID="txtRemark" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td>
            &nbsp;
        </td><td>
           &nbsp;
        </td></tr>
    
    <tr><td colspan="4" align="right"><asp:Button ID="Button1" CssClass="button" runat="server" 
            Text="Add" onclick="Button1_Click" 
            onclientclick="return confirm('Are you sure you want to save?');" /></td></tr></table>

<table width="100%"><tr><td align="right"><input value="Add" onclick="javascript:add();" class="button" type="button" /></td></tr></table>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333" 
            GridLines="None" AutoGenerateColumns="False">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:TemplateField HeaderText="No." ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
       
        <asp:TemplateField HeaderText="Test item" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("TESTITEMNAME") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Department" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Eval("department") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Creat time" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label4" runat="server" Text='<%#Eval("CREATETIME").ToString()==""?"":DateTime.Parse(Eval("CREATETIME").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Created by" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label5" runat="server" Text='<%# Eval("createby") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Remark" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label6" runat="server" Text='<%# Eval("REMARK") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:HyperLinkField DataNavigateUrlFields="ID" Visible="false" HeaderText="Edit" ItemStyle-HorizontalAlign="Center"
            DataNavigateUrlFormatString="SampleCardCreat.aspx?DID={0}" Text="Edit" />
             <asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl=<%#"javascript:edit("+Eval("ID")+");" %> runat="server">Edit</asp:LinkButton>
                <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+");" %>" />
            </ItemTemplate>
        </asp:TemplateField>
           <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" Visible="false"  runat="server" onclientclick="return confirm('Please confirm to delete the file.')" 
                        PostBackUrl=<%# "SampleCardCreat.aspx?deid="+Eval("ID") %>
                        >Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete"  onclick="<%#"javascript:del("+Eval("ID")+");" %>" />
                        
                </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EditRowStyle BackColor="#2E8AC5" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    </div>
    
    
    </form>
</body>
</html>
